This invention relates generally to software development tools, and more particularly for the maintenance of code knowledge for up-to-date access thereof by and for such tools.
Traditional software development tools are generally limited in the degree of assistance and task automation they provide for the software developers that use them. These limitations can largely be attributed to the lack of up-to-date information that the tools themselves possess about the code being developed. Generally, development tools maintain a textual form of a source code (or, source data) of a computer program being developed. However, deeper representation, derived from processing and analysis of the source text, may not be maintained at all, or may be maintained but not always kept current. As used herein, this deeper representation is referred to generically and in a general sense as code knowledge, since a development tool may put the knowledge to any number of different uses.
Usually, traditional tools gather their code knowledge at infrequent intervals, such as when the user compiles the entire program or saves an individual source file to a storage such as a hard disk drive. During the intervening periods, the derived information becomes Astale,@ as the user changes the source code. The code knowledge in such instances becomes out of date.
A problem in maintaining up-to-date code knowledge is flushing stale information from a system when it has been superseded by newer information. If other parts of the development tool are actively using data, or are merely keeping pointers to the data for subsequent use, it generally is impractical to just destroy the old data. Doing so may require a complex notification scheme, allowing each part of the system to switch over to the new data before the old data can be safely destroyed.
For these and other reasons, there is a need for the present invention.
The invention provides for maintenance of code knowledge for up-to-date access thereof. In one embodiment, a computer-implemented method for providing code knowledge is in response to receiving a request for code knowledge regarding a computer program. The method first creates a proxy, then a node to which the proxy is pointed by a unique node key and which includes the code knowledge. The method updates the node as necessary to provide accurate code knowledge. For example, in one particular embodiment, the method sets a flag of the proxy indicating the node as invalid upon a change event (e.g., such as modification to the source code from which the code knowledge was parsed occurring). Thus, upon the flag of the proxy indicating the node as invalid, and upon receiving a second request for the code knowledge, the method recreates the node (and, in one embodiment, first deleting the node before recreating it).
Thus, the invention provides for advantages not found in the prior art. Embodiments of the invention solve the problem of maintaining up-to-date code knowledge by introducing a layer of objects called proxies, through which all access to code knowledge is performed. Other parts of the system refer only to these proxies, which are not destroyed when the source text changes (unlike the nodes, for example).
The use of proxies also confers other advantages for the invention. Proxies can transparently derive their knowledge using many different mechanismsxe2x80x94for example, if the source code has not changed since the last time it was compiled, it may be more efficient to derive some of the code knowledge by loading a compiled binary file, rather than by parsing the source code.
The invention includes systems, methods, computers, and computer-readable media of varying scope. Besides the embodiments, advantages and aspects of the invention described here, the invention also includes other embodiments, advantages and aspects, as will become apparent by reading and studying the drawings and the following description.